package com.itheima.mapper;

import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface Usermapper {
    //查询所有
    @Select("select * from tbl_account")
    List<User> findAll();
    //通过id查询
    @Select("select * from tbl_account where id=#{id}")
    User findbyid(int id);
    //增加
    @Insert("insert into tbl_account values(null,#{name},null)")
    int add (User user);
    //修改
    @Update("update tbl_account set id=#{id},name=#{name} where id=#{id}")
    int updateUser(User user);
    //删除
    @Delete("delete from tbl_account where id=#{id}")
    int deletebyid(int id);
}
